home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Nebula 2
/
Nebula Two.iso
/
SourceCode
/
GameKit
/
Examples
/
PacMan
/
MonsterMovement.h
< prev
next >
Wrap
Text File
|
1995-06-12
|
6KB
|
126 lines
// MonsterMovement.h
//
// static data arrays that tell the monsters how to move.
// they are used by various methods in the Monster class.
static intm fxvec[16] = {
{ 0, 0, 0, 0, 0, 0, 0, 0 }, // no way to go
{ 2, 2, 2, 2, 2, 2, 2, 2 }, // right only
{ -2, -2, -2, -2, -2, -2, -2, -2 }, // left only
{ -2, 2, 2, -2, 2, -2, -2, 2 }, // left or right
{ 0, 0, 0, 0, 0, 0, 0, 0 }, // down only
{ 0, 0, 0, 0, 2, 2, 2, 2 }, // down or right
{ -2, 0, 0, -2, 0, -2, -2, -2 }, // down or left
{ -2, 0, 0, -2, 2, -2, -2, 2 }, // down, left, or right
{ 0, 0, 0, 0, 0, 0, 0, 0 }, // up only
{ 2, 2, 2, 0, 2, 0, 0, 0 }, // up or right
{ -2, -2, -2, -2, 0, -2, 0, 0 }, // up or left
{ -2, -2, 2, -2, 2, 0, 0, 2 }, // up, left, or right
{ 0, 0, 0, 0, 0, 0, 0, 0 }, // up or down
{ 0, 0, 2, 0, 2, 0, 0, 2 }, // up, down, or right
{ -2, 0, 0, -2, 0, 0, 0, 0 }, // up, down, or left
{ -2, 0, 0, -2, 2, 0, 0, 2 } }; // any which way
static intm fyvec[16] = {
{ 0, 0, 0, 0, 0, 0, 0, 0 }, // no way to go
{ 0, 0, 0, 0, 0, 0, 0, 0 }, // right only
{ 0, 0, 0, 0, 0, 0, 0, 0 }, // left only
{ 0, 0, 0, 0, 0, 0, 0, 0 }, // left or right
{ -2, -2, -2, -2, -2, -2, -2, -2 }, // down only
{ -2, -2, -2, -2, 0, 0, 0, 0 }, // down or right
{ 0, -2, -2, 0, -2, 0, 0, 0 }, // down or left
{ 0, -2, -2, 0, 0, 0, 0, 0 }, // down, left, or right
{ 2, 2, 2, 2, 2, 2, 2, 2 }, // up only
{ 0, 0, 0, 2, 0, 2, 2, 2 }, // up or right
{ 0, 0, 0, 0, 2, 0, 2, 2 }, // up or left
{ 0, 0, 0, 0, 0, 2, 2, 0 }, // up, left, or right
{ -2, -2, -2, 2, -2, 2, 2, 2 }, // up or down
{ -2, -2, 0, -2, 0, 2, 2, 0 }, // up, down, or right
{ 0, -2, -2, 0, 2, 2, 2, 2 }, // up, down, or left
{ 0, -2, 2, 0, 0, -2, 2, 0 } }; // any which way
static intm rxvec[16] = {
{ 0, 0, 0, 0, 0, 0, 0, 0 }, // no way to go
{ 1, 1, 1, 1, 1, 1, 1, 1 }, // right only
{ -1, -1, -1, -1, -1, -1, -1, -1 }, // left only
{ 1, -1, -1, 1, -1, 1, 1, -1 }, // left or right
{ 0, 0, 0, 0, 0, 0, 0, 0 }, // down only
{ 1, 1, 0, 0, 0, 0, 1, 0 }, // down or right
{ 0, -1, -1, 0, 0, 0, -1, -1 }, // down or left
{ 1, 1, -1, 0, 0, 1, 1, -1 }, // down, left, or right
{ 0, 0, 0, 0, 0, 0, 0, 0 }, // up only
{ 1, 1, 0, 0, 0, 1, 1, 0 }, // up or right
{ 0, -1, -1, 0, 0, 0, -1, -1 }, // up or left
{ 1, -1, -1, 0, 0, 0, -1, -1 }, // up, left, or right
{ 0, 0, 0, 0, 0, 0, 0, 0 }, // up or down
{ 0, 1, 0, 0, 0, 1, 1, 0 }, // up, down, or right
{ 0, -1, -1, 0, 0, 0, -1, -1 }, // up, down, or left
{ 1, -1, 0, 0, 0, 0, 1, -1 } }; // any which way
static intm ryvec[16] = {
{ 0, 0, 0, 0, 0, 0, 0, 0 }, // no way to go
{ 0, 0, 0, 0, 0, 0, 0, 0 }, // right only
{ 0, 0, 0, 0, 0, 0, 0, 0 }, // left only
{ 0, 0, 0, 0, 0, 0, 0, 0 }, // left or right
{ -1, -1, -1, -1, -1, -1, -1, -1 }, // down only
{ 0, 0, -1, -1, -1, -1, 0, -1 }, // down or right
{ -1, 0, 0, -1, -1, -1, 0, 0 }, // down or left
{ 0, 0, 0, -1, -1, 0, 0, 0 }, // down, left, or right
{ 1, 1, 1, 1, 1, 1, 1, 1 }, // up only
{ 0, 0, 1, 1, 1, 0, 0, 1 }, // up or right
{ 1, 0, 0, 1, 1, 1, 0, 0 }, // up or left
{ 0, 0, 0, 1, 1, 1, 0, 0 }, // up, left, or right
{ 1, 1, 1, 1, -1, -1, -1, -1 }, // up or down
{ 1, 0, 1, 1, -1, 0, 0, -1 }, // up, down, or right
{ 1, 0, 0, -1, 1, -1, 0, 0 }, // up, down, or left
{ 0, 0, 1, 1, -1, -1, 0, 0 } }; // any which way
static intm pxvec[16] = {
{ 0, 0, 0, 0, 0, 0, 0, 0 }, // no way to go
{ 4, 4, 4, 4, 4, 4, 4, 4 }, // right only
{ -4, -4, -4, -4, -4, -4, -4, -4 }, // left only
{ -4, 4, 4, -4, 4, -4, -4, 4 }, // left or right
{ 0, 0, 0, 0, 0, 0, 0, 0 }, // down only
{ 0, 0, 0, 0, 4, 4, 4, 4 }, // down or right
{ 0, 0, 0, -4, 0, -4, -4, -4 }, // down or left
{ -4, 0, 0, -4, 4, -4, -4, 4 }, // down, left, or right
{ 0, 0, 0, 0, 0, 0, 0, 0 }, // up only
{ 0, 4, 4, 0, 4, 0, 0, 0 }, // up or right
{ -4, -4, -4, -4, 0, -4, 0, 0 }, // up or left
{ -4, -4, 4, -4, 4, 0, 0, 4 }, // up, left, or right
{ 0, 0, 0, 0, 0, 0, 0, 0 }, // up or down
{ 0, 0, 4, 0, 4, 0, 0, 4 }, // up, down, or right
{ -4, 0, 0, -4, 0, -4, 0, 0 }, // up, down, or left
{ 0, 0, 4, -4, 4, -4, 0, 0 } }; // any which way
static intm pyvec[16] = {
{ 0, 0, 0, 0, 0, 0, 0, 0 }, // no way to go
{ 0, 0, 0, 0, 0, 0, 0, 0 }, // right only
{ 0, 0, 0, 0, 0, 0, 0, 0 }, // left only
{ 0, 0, 0, 0, 0, 0, 0, 0 }, // left or right
{ -4, -4, -4, -4, -4, -4, -4, -4 }, // down only
{ -4, -4, -4, -4, 0, 0, 0, 0 }, // down or right
{ -4, -4, -4, 0, -4, 0, 0, 0 }, // down or left
{ 0, -4, -4, 0, 0, 0, 0, 0 }, // down, left, or right
{ 4, 4, 4, 4, 4, 4, 4, 4 }, // up only
{ 4, 0, 0, 4, 0, 4, 4, 4 }, // up or right
{ 0, 0, 0, 0, 4, 0, 4, 4 }, // up or left
{ 0, 0, 0, 0, 0, 4, 4, 0 }, // up, left, or right
{ -4, -4, -4, 4, -4, 4, 4, 4 }, // up or down
{ -4, -4, 0, -4, 0, 4, 4, 0 }, // up, down, or right
{ -4, -4, -4, 0, 4, 0, 4, 4 }, // up, down, or left
{ -4, -4, 0, 0, 0, 0, 4, 4 } }; // any which way
static intm find[3] = { { 0, 1, 2 }, { 3, 3, 4 }, { 5, 6, 7 } };
// power dot behavior
static int flash_ticks[] = {
13, 13, 8, 4, 1, 13, 8, 4, 1,
8, 4, 1, 4, 1, 8, 4, 1,
0, 0, 8, 4, 0, 0, 1, 0 };
static int off_ticks[] = {
19, 19, 14, 10, 7, 19, 14, 10, 7,
14, 10, 7, 10, 7, 14, 10, 7,
1, 1, 14, 10, 1, 1, 7, 1 };
// and that's all the movement data!